#include "Complex.h"

template<typename T>
Complex<T>::Complex(T a, T b)
{
	this->a = a;
	this->b = b;

	cout <<"Constructors --Complex--"<<endl;
}

template<typename T>
Complex<T>::~Complex(void)
{
	cout <<"\nDestructor --Complex--"<<endl;
}

template<typename T>
Complex<T>::Complex(const Complex& c)
{
	a = c.a;
	b = c.b;
	cout <<"COPY-Constructors --Complex--"<<endl;
}

template<typename T>
Complex<T> Complex<T>::operator+ (Complex<T>& r)
{
	Complex tmp(this->a + r.a, this->b + r.b);
	return tmp;
}

template<typename T>
Complex<T>& Complex<T>::operator= (Complex<T>& r)
{
	this->a = r.a;
	this->b = r.b;
	return *this;
}

template<typename T>
ostream & operator<<(ostream &out, Complex<T> &r)
{
	out<<"z = "<<r.a<<" + "<<r.b<<"i"<<endl;
	return out;
}